<?php
class Account_recharge{
	var $CI;

	public function __construct() {
		$this->CI =& get_instance();
		date_default_timezone_set('Asia/Shanghai');
	}
	public function insert_recharge($data) {
		$insert['order_sn']		= "RGMPOS".date('YmdHis') . str_pad(mt_rand(1, 9999999), 7, '0', STR_PAD_LEFT);
		$insert['amount']		= $data['money'];
		$insert['pay_type']		= $data['pay_type'];
		$insert['created_by']	= $data['created_by'];
		$insert['account_no']	= $data['account_no'];
		$insert['tran_id']		= $data['tran_id'];
		$insert['pay_status']	=0;
		$insert['pay_time']		="";
		$insert['created_time']	=date("Y-m-d H:i:s");
		$this->CI->load->model("sws_recharge_order_model");
		$this->CI->sws_recharge_order_model->insert_order($insert);
		return 	$insert['order_sn'];
	}
}